package com.futureCloudMOM.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.futureCloudMOM.core.base.service.impl.BaseServiceImpl;
import com.futureCloudMOM.core.domain.WmsBarCodeQuan;
import com.futureCloudMOM.core.service.WmsBarCodeQuanService;
import com.futureCloudMOM.core.mapper.WmsBarCodeQuanMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【WMS_BarCodeQuan】的数据库操作Service实现
 *
 * @author Administrator
 * @since 2023-06-07 09:14:43
 */
@AllArgsConstructor
@Service
public class WmsBarCodeQuanServiceImpl extends BaseServiceImpl<WmsBarCodeQuanMapper, WmsBarCodeQuan> implements WmsBarCodeQuanService {

    //条码库位
    private final WmsBarCodeQuanMapper quanMapper;

    @Override
    public void delBarcodeQuanByCode(String BarCode) {
        List<WmsBarCodeQuan> list = quanMapper.selectList(new LambdaQueryWrapper<WmsBarCodeQuan>()
                .eq(WmsBarCodeQuan::getBarCode, BarCode)
                .eq(WmsBarCodeQuan::getDeleted, "0"));
        list.forEach(quanMapper::deleteById);
    }
}
